#!/bin/bash
SEVER_URL='http://192.168.10.102:3009'
SEND_URL=$SEVER_URL'/api/bot/send_to_user/'
UID=1
X_API_KEY='744e60e07997658f259120934f34ffc005fa3a7a8869f4e10e61d8f6d384e5397b22756964223a322c226e6f6e6365223a222f372b7a4a4e4844504755414141414144327958597a62394f356b516c6d3772227d'
MESSAGE_TITLE=$1
MESSAGE_DATA=$2

function LOG() {
    USER=$(whoami) ####那个用户在操作
    if [ ! -f ${LOG_FILE} ];then
       touch ${LOG_FILE}
    fi
    echo "[${DATE}] ${USER} [$1] $2"
    echo "[${DATE}] ${USER} [$1] $2" >> ${LOG_FILE}  ######�?0脚本本身�?@将参数作为整体传输调�? >> 将输出结果以追加的方式添加重定向到本地文件中�?
}

curl --location --request POST $SEND_URL$UID \
--header 'x-api-key: $X_API_KEY' \
--header 'Content-Type: text/plain' \
--data-raw "[$MESSAGE_TITLE]\n--$MESSAGE_DATA"